﻿using System.Collections.Generic;

namespace WeWork.Model
{
    /// <summary>
    /// 填表消息
    /// </summary>
    public class ChatCollect : MsgChatRoomBase
    {
        /*
        {
            "msgid":"2500536226619379797_1576034482",
            "action":"send",
            "from":"nick",
            "tolist":["XuJinSheng","15108264797"],
            "roomid":"wrjc7bDwYAOAhf9quEwRRxyyoMm0QAAA",
            "msgtime":1576034482344,
            "msgtype":"collect",
            "collect":{
                "room_name":"这是一个群",
                "creator":"nick",
                "create_time":"2019-12-11 11:21:22",
                "title":"这是填表title",
                "details":[
                    {"id":1,"ques":"表项1，文本","type":"Text"},
                    {"id":2,"ques":"表项2，数字","type":"Number"},
                    {"id":3,"ques":"表项3，日期","type":"Date"},
                    {"id":4,"ques":"表项4，时间","type":"Time"}
                ]
            }
        } 
        */
        /// <summary>
        /// 消息内容
        /// </summary>
        public CollectInfo collect { set; get; }
    }

    public class CollectInfo
    {
        /// <summary>
        /// 填表消息所在的群名称。String类型
        /// </summary>
        public string room_name { set; get; }
        /// <summary>
        /// 创建者在群中的名字。String类型
        /// </summary>
        public string creator { set; get; }
        /// <summary>
        /// 创建的时间。String类型 "2019-12-11 11:21:22"
        /// </summary>
        public string create_time { set; get; }
        /// <summary>
        /// 表名。String类型
        /// </summary>
        public string title { set; get; }
        /// <summary>
        /// 表内容。json数组类型
        /// </summary>
        public List<CollectDetail> details { set; get; }
    }

    public class CollectDetail
    {
        /// <summary>
        /// 表项id。Uint64类型
        /// </summary>
        public int id { set; get; }
        /// <summary>
        /// 表项名称。String类型
        /// </summary>
        public string ques { set; get; }
        /// <summary>
        /// 表项类型，有Text(文本),Number(数字),Date(日期),Time(时间)。String类型
        /// </summary>
        public string type { set; get; }
    }
}
